/**
 * 
 */
package net.loyintean.pearlshell.logcenter.model.impl;

import net.loyintean.pearlshell.logcenter.model.IConfigFactory;
import net.loyintean.pearlshell.logcenter.model.IConfigModel;


/**
 * @author Administrator
 * 
 */
public class ConfigFactoryImpl implements IConfigFactory{

	private String systemName;

	private String url;

	private String destinationName;

	private String userName;

	private String passWord;
	
	@Deprecated
	public static final IConfigModel build(String systemName, String url,
			String destinationName) {
		ConfigModelImpl config = new ConfigModelImpl();

		config.setSystemName(systemName);
		config.setUrl(url);
		config.setDestinationName(destinationName);

		return config;
	}

	public final IConfigModel build() {
		ConfigModelImpl config = new ConfigModelImpl();

		config.setSystemName(systemName);
		config.setUrl(url);
		config.setDestinationName(destinationName);
		config.setUserName(userName);
		config.setPassWord(passWord);

		return config;
	}

	/**
	 * @param systemName
	 *            the systemName to set
	 */
	public IConfigFactory setSystemName(String systemName) {
		this.systemName = systemName;
		return this;
	}

	/**
	 * @param url
	 *            the url to set
	 */
	public IConfigFactory setUrl(String url) {
		this.url = url;
		return this;
	}

	/**
	 * @param destinationName
	 *            the destinationName to set
	 */
	public IConfigFactory setDestinationName(String destinationName) {
		this.destinationName = destinationName;
		return this;
	}

	/**
	 * @param userName
	 *            the userName to set
	 */
	public IConfigFactory setUserName(String userName) {
		this.userName = userName;
		return this;
	}

	/**
	 * @param passWord
	 *            the passWord to set
	 */
	public IConfigFactory setPassWord(String passWord) {
		this.passWord = passWord;
		return this;
	}

	/* (non-Javadoc)
	 * @see com.sinosig.pearlshell.logcenter.model.IConfigFactory#getInstance()
	 */
	@Override
	public IConfigFactory getFactory() {
		return new ConfigFactoryImpl();
	}

}
